home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-11-17 | 4.1 KB | 175 lines | [TEXT/MPS ] |
- //
- // FTIntf.h
- // C Interface to the File Transfer Manager
-
- // Copyright © Apple Computer, Inc. 1988, 1989
- // All rights reserved
- //
-
- #ifndef __FTINTF__
- #define __FTINTF__
-
- #ifndef __PACKAGES__
- #include <Packages.h>
- #endif
-
- #ifndef __CTBUTILS__
- #include <CTBUtils.h>
- #endif
-
- // current file transfer manager version
- #define curFTVersion 1
-
- // FTErr
- typedef OSErr FTErr;
-
- #define ftGenericError -1
- #define ftNoErr 0
- #define ftRejected 1
- #define ftFailed 2
- #define ftTimeOut 3
- #define ftTooManyRetry 4
- #define ftNotEnoughDSpace 5
- #define ftRemoteCancel 6
- #define ftWrongFormat 7
- #define ftNoTools 8
- #define ftUserCancel 9
- #define ftNotSupported 10
-
- // FTDirection
- typedef short FTDirection;
-
- enum {
- ftReceiving,
- ftTransmitting,
- ftFullDuplex
- };
-
- // FTFlags
- typedef unsigned long FTFlags;
-
- enum {
- ftIsFTMode = 1 << 0,
- ftNoMenus = 1 << 1,
- ftQuiet = 1 << 3,
- ftSucc = 1 << 7
- };
-
- // FTAttributes
- typedef short FTAttributes;
- enum {
- ftSameCircuit = 1 << 0,
- ftSendDisable = 1 << 1,
- ftReceiveDisable = 1 << 2,
- ftTextOnly = 1 << 3,
- };
-
- struct FTRecord
- {
- short procID;
-
- FTFlags flags;
- FTErr errCode;
-
- long refCon;
- long userData;
-
- ProcPtr defProc;
-
- Ptr config;
- Ptr oldConfig;
-
- ProcPtr environsProc;
- long reserved1;
- long reserved2;
-
- Ptr ftPrivate;
-
- ProcPtr sendProc;
- ProcPtr recvProc;
- ProcPtr writeProc;
- ProcPtr readProc;
-
- WindowPtr owner;
-
- FTDirection direction;
- SFReply theReply;
-
- long writePtr;
- long readPtr;
- char *theBuf;
- long bufSize;
- Str255 autoRec;
- FTAttributes attributes;
- };
-
- #ifndef _cplusplus
- typedef struct FTRecord FTRecord;
- #endif
-
- typedef FTRecord *FTPtr, **FTHandle;
-
-
- #ifdef __safe_link
- extern "C" {
- #endif
- extern pascal FTErr InitFT(void);
- extern pascal Handle FTGetVersion(FTHandle hFT);
- extern pascal short FTGetFTVersion(void);
-
- extern pascal FTHandle FTNew(short procID, FTFlags flags, ProcPtr sendProc,
- ProcPtr recvProc, ProcPtr readProc, ProcPtr writeProc,
- ProcPtr environsProc, WindowPtr owner, long refCon,
- long userData);
-
- extern pascal void FTDispose(FTHandle hFT);
-
- extern pascal FTErr FTStart(FTHandle hFT, FTDirection direction, const SFReply *fileInfo);
- extern pascal FTErr FTAbort(FTHandle hFT);
-
- extern pascal void FTExec(FTHandle hFT);
-
- extern pascal void FTActivate(FTHandle hFT, Boolean activate);
- extern pascal void FTResume(FTHandle hFT, Boolean resume);
- extern pascal Boolean FTMenu(FTHandle hFT, short menuID, short item);
-
- extern pascal short FTChoose(FTHandle *hFT, Point where, ProcPtr idleProc);
- extern pascal void FTEvent(FTHandle hFT, const EventRecord *theEvent);
-
- extern pascal Boolean FTValidate(FTHandle hFT);
- extern pascal void FTDefault(Ptr *theConfig, short procID, Boolean allocate);
-
- extern pascal Handle FTSetupPreflight(short procID, long *magicCookie);
- extern pascal void FTSetupSetup(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, long *magicCookie);
- extern pascal Boolean FTSetupFilter(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, EventRecord *theEvent,
- short *theItem, long *magicCookie);
- extern pascal void FTSetupItem(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, short *theItem, long *magicCookie);
- extern pascal void FTSetupCleanup(short procID, Ptr theConfig, short count,
- DialogPtr theDialog, long *magicCookie);
- extern pascal void FTSetupPostflight(short procID);
-
- extern pascal Ptr FTGetConfig(FTHandle hFT);
- extern pascal short FTSetConfig(FTHandle hFT, Ptr thePtr);
-
- extern pascal OSErr FTIntlToEnglish(FTHandle hFT, Ptr inputPtr, Ptr *outputPtr,
- short language);
- extern pascal OSErr FTEnglishToIntl(FTHandle hFT, Ptr inputPtr, Ptr *outputPtr,
- short language);
-
- extern pascal void FTSetRefCon(FTHandle hFT, long refCon);
- extern pascal long FTGetRefCon(FTHandle hFT);
-
- extern pascal void FTSetUserData(FTHandle hFT, long userData);
- extern pascal long FTGetUserData(FTHandle hFT);
-
- extern pascal void FTGetToolName(short procID, Str255 name);
- extern pascal short FTGetProcID(const Str255 name);
-
- #ifdef __safe_link
- }
- #endif
-
- #endif __FTINTF__